package IO;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.nio.charset.StandardCharsets;
import java.util.Scanner;

public class test {
    public static void main(String[] args) throws IOException {
        FileOutputStream fos = new FileOutputStream("note.txt");
        OutputStreamWriter osw = new OutputStreamWriter(fos, StandardCharsets.UTF_8);
        Scanner scan = new Scanner(System.in);
        String s = "exit";
        for(;;) {
            String str = scan.nextLine();
            if (s.equals(str)) {
                System.out.println("程序退出");
                break;
            }
            osw.write(str);
        }






























    }
}
